UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nx0Q65bA5gIiXr3TiuemPYgfy7u7FrHmUcxcMDMtZIQ=' 
WHERE 
  key_id = '11c2f14ed8314bdff7ca8c0147baa3ad85a19d7c0e69a11ca73a71b1a74f62f0' 
  AND (
    token = 'nx0Q65bA5gIiXr3TiuemPYgfy7u7FrHmUcxcMDMtZIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026