UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gZxMC53FECAF2KHGwGPZ3GxPP5V1C9ROl6tfN5y43PY=' 
WHERE 
  key_id = '0b1eb9dbff30c4cbd112cf74e6e46ea5f3c145af1e804f0c059099f49dd4ea55' 
  AND (
    token = 'gZxMC53FECAF2KHGwGPZ3GxPP5V1C9ROl6tfN5y43PY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025