UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yzgpjAiI/0icpTYA37mmQxNSTuDMISiUam1dT8u1eq0=' 
WHERE 
  key_id = '93aab8f42b4aae5520bca76c9cc01896d4018b140c105be0b0fcb7996cdf2e70' 
  AND (
    token = 'yzgpjAiI/0icpTYA37mmQxNSTuDMISiUam1dT8u1eq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033