UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uetIK6EdtqhKQ7/0ACoiIyibnqntBjzzHRTGLMSe2nY=' 
WHERE 
  key_id = '54c768d1e945f8b35823889af53a64d76cefc00b3b2f0ccc9e2f1099ababf98c' 
  AND (
    token = 'uetIK6EdtqhKQ7/0ACoiIyibnqntBjzzHRTGLMSe2nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045