UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PM4k6ke+gwjOMCKegw7LfKCSaSnNO0aQEkv1xkoYerY='
WHERE
key_id = '5054ffac60e47f0a13c903f7eaf810b9222b3a0f083a06f06a0f648ffc6b93a3'
AND (
token = 'PM4k6ke+gwjOMCKegw7LfKCSaSnNO0aQEkv1xkoYerY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)