UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fmxrgZ8ck2tTHfa243rt3q7ZOolHRWoqszbAlQGDGYQ=' 
WHERE 
  key_id = '924b2e3d705ab017bf3fe84f219bd5b5385f510f293429b040487996173b239e' 
  AND (
    token = 'fmxrgZ8ck2tTHfa243rt3q7ZOolHRWoqszbAlQGDGYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025