UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'naLQD92KvjMBzQuL2OXulqXz5eb5DAKwoNR99IsE9KY=' 
WHERE 
  key_id = '60e6498e3730b685be32054472ff3a309e7f9c867cdbc639caa7cb0084d67487' 
  AND (
    token = 'naLQD92KvjMBzQuL2OXulqXz5eb5DAKwoNR99IsE9KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028