UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9KSTgH0Wl3SlGaOaNjV4Olxg9ej1QMeS/3KEzPcLJZc=' 
WHERE 
  key_id = '96012129cedbd2e7bf54c9959dbb974428b63cbbd0a7fad8fa51fce26df10d6f' 
  AND (
    token = '9KSTgH0Wl3SlGaOaNjV4Olxg9ej1QMeS/3KEzPcLJZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038