UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YiMJ7OttDqy0ge1ZXOGI5+x5xzgjVdyPpjh21TO2/AM='
WHERE
key_id = '84ad9796e9e30cf10a34d9368751e3e72a8d9a082c50f987475f79c33880b9c8'
AND (
token = 'YiMJ7OttDqy0ge1ZXOGI5+x5xzgjVdyPpjh21TO2/AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)