UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35oOltKG9BEAYmbUYtWC4g/iYTKo/2VDpTLubZ/c50w=' 
WHERE 
  key_id = '5eda2c7944a67758d1f1e24db2c10585f2a53a69d9874837a8d712b849e4697e' 
  AND (
    token = '35oOltKG9BEAYmbUYtWC4g/iYTKo/2VDpTLubZ/c50w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030