UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bnM9RJJHk/qvqEBa/Qqzhf1BHzNZHmUxs63VJYO9kB0=' 
WHERE 
  key_id = '3bc571a029181b00d09dad2d40f531bde6c6a1e3220bb25047563d6dfd1b85ec' 
  AND (
    token = 'bnM9RJJHk/qvqEBa/Qqzhf1BHzNZHmUxs63VJYO9kB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044