UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kgPvDOLON1tVThpKwdAqZ1HGEmRsNl/e/wsGysNPM5Q=' 
WHERE 
  key_id = 'a182f70da24df9fdd69415a3631c7e8651933ae9815bd4f4e88401cc00f68e4b' 
  AND (
    token = 'kgPvDOLON1tVThpKwdAqZ1HGEmRsNl/e/wsGysNPM5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056