UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hvhUb/q8vjHjEw3thnRs7918iiiEElJZbT6UofTxWSo=' 
WHERE 
  key_id = 'ef66eb5db27a65c2a3860bfbd34103b7bde4193f6873c1b5b5ed7332880eab48' 
  AND (
    token = 'hvhUb/q8vjHjEw3thnRs7918iiiEElJZbT6UofTxWSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028