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