UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd5gQTOfoQYd+6X4FWkA2OdhDIT6lQ/XW0koeg3xWnLM=' 
WHERE 
  key_id = '5f1f128f722d2e4337cf3dfda7a7daa79297f052fcd422f58216e8cce029ce0d' 
  AND (
    token = 'd5gQTOfoQYd+6X4FWkA2OdhDIT6lQ/XW0koeg3xWnLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021