UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tUJK4g/qFJaq8vVbeeMzbUgOojDytSFt2xkccE9aCCM=' 
WHERE 
  key_id = '034853f7a26ba2b4a5e2580193aab42361e42573ba773455384a8f600cce4405' 
  AND (
    token = 'tUJK4g/qFJaq8vVbeeMzbUgOojDytSFt2xkccE9aCCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040