UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q5bF/w0iqzuPdaflDwr+6UIeScKwi3UKGZUWfJApwUo=' 
WHERE 
  key_id = '96ba71fd1677ff52ba94e0da990e7cbb11ca1be086d5b22e924032f5cb8f7f4b' 
  AND (
    token = 'Q5bF/w0iqzuPdaflDwr+6UIeScKwi3UKGZUWfJApwUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039