UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l74KKfGacPqzQc4iImqefgoOmo+5cjFyQarmUVJAR7g=' 
WHERE 
  key_id = '7ff2a4647b3d2cfe5eba32150640a9659894b45ffe42216eda9566ee96da16d6' 
  AND (
    token = 'l74KKfGacPqzQc4iImqefgoOmo+5cjFyQarmUVJAR7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027