UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qd9ZRF/TcWC3SffjMf7KMOaPWmgVJRSzC653LK8H9x4='
WHERE
key_id = '06ba8c4823c9c8bf0de963961c5062f721db0453c3f683898371a2225befd2c9'
AND (
token = 'Qd9ZRF/TcWC3SffjMf7KMOaPWmgVJRSzC653LK8H9x4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)