UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ns8xCPnh9dBqkZKwl0kV32hQ5ldobN7X/oBMnjJyK4c=' 
WHERE 
  key_id = 'fdf97612472c5df1c0d519ff3a323ef784ae6e3e1bec75d8e74677c581136dc8' 
  AND (
    token = 'Ns8xCPnh9dBqkZKwl0kV32hQ5ldobN7X/oBMnjJyK4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017