UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HaG73UjNsEMwSlaqGoNyJdFkyprwLMbDxAmR+bdQ1kM=' 
WHERE 
  key_id = '5d908f2cbd501666f38be85704ef73eb5f858377a983f2d141a6187a0253c463' 
  AND (
    token = 'HaG73UjNsEMwSlaqGoNyJdFkyprwLMbDxAmR+bdQ1kM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028