UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H7LQ7WV8tx3ivO9BsF2dyydASbQfO5zHw43Ef8e6Axw=' 
WHERE 
  key_id = 'a764379fec664e3b5dbb643a3211baa2929dab01d7825d6c3025b72e730dbc42' 
  AND (
    token = 'H7LQ7WV8tx3ivO9BsF2dyydASbQfO5zHw43Ef8e6Axw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047