UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MWKjormAfnEK98wf7qG8HDWc8ZzQzGbuP6K1OXwKkYQ=' 
WHERE 
  key_id = '0e7a531f653cb70ccd35b01ad360ac684fd2c1854d4236d868945f3bbbc500d8' 
  AND (
    token = 'MWKjormAfnEK98wf7qG8HDWc8ZzQzGbuP6K1OXwKkYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039