UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fN2ZlIde+UZ/eZimpQb2oI33xrEu2xf36PGFIgc0Fk='
WHERE
key_id = 'c86f0bf21807bcac025c1dbf26e8cbfded862051243266813fbe0e5f0f692abe'
AND (
token = '9fN2ZlIde+UZ/eZimpQb2oI33xrEu2xf36PGFIgc0Fk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)