UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nEcZ03ChO9+0wCnpHtGRQICWACfJaY8lFAZLZPyL72U=' 
WHERE 
  key_id = '5c3abf6bda51b4f5e9312a5a8a8643f417e4d72819959613c2770593c5c291c8' 
  AND (
    token = 'nEcZ03ChO9+0wCnpHtGRQICWACfJaY8lFAZLZPyL72U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039