UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QoJ3OWYQx9VfFeNCkGlF0+xb5hd7Mbs1MJS4yEmAzCw='
WHERE
key_id = '22422084e993623b7d39e350751a44ba653a88a2bdcc51df029dd75701b7a87b'
AND (
token = 'QoJ3OWYQx9VfFeNCkGlF0+xb5hd7Mbs1MJS4yEmAzCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)