UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rEGz0NVIdyIhoyTAyFzTBK+tkzZT2y1FGAe8PHDSEeM=' 
WHERE 
  key_id = '5ac0c8816548097712cff95cf7bb28caa8edb1799d2ac953ee1c8ec382a28447' 
  AND (
    token = 'rEGz0NVIdyIhoyTAyFzTBK+tkzZT2y1FGAe8PHDSEeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032