UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qGQCb2+8CIQ87aGArirc6q9f4CJoojj1c5ILWvpNPMU=' 
WHERE 
  key_id = '6d0cc070d7cadfcb840b55d08465396efe4186682c52962062b722dbd619df58' 
  AND (
    token = 'qGQCb2+8CIQ87aGArirc6q9f4CJoojj1c5ILWvpNPMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034