UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2kMLZH9T3mcryMN2aLkOPHfpxCicfB+P98irPKhynUg=' 
WHERE 
  key_id = '8b9c56f351bbff958320d9a85e2be5a75ee7565668180d5f30a9357784f5e98b' 
  AND (
    token = '2kMLZH9T3mcryMN2aLkOPHfpxCicfB+P98irPKhynUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054