UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'waHpKTLXRlf0tlH+XItdGJ/8xCGAwDr4DRY7goaWkbM=' 
WHERE 
  key_id = '4ddeab32a2f9b9d14f519b20513ae3d72b402a1300aba7be0c7d8029651253e6' 
  AND (
    token = 'waHpKTLXRlf0tlH+XItdGJ/8xCGAwDr4DRY7goaWkbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038