UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7KTjRVoCUepZ22DeD4K0QmJ+RucFihAa2BYkvkCbhM='
WHERE
key_id = 'dcdbeaf637f743b74023685fa265c1f3b42f325757f40b3df15ee5ebe2f8c686'
AND (
token = 'R7KTjRVoCUepZ22DeD4K0QmJ+RucFihAa2BYkvkCbhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)