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