UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S3S9HFI1tZy7yJXsWxsdJZXUchujiz149LyPwHPq9qA='
WHERE
key_id = 'b0abd49d4bbcc1d4b88080ad477c2f6d6251c5d5789a868b7bc79f8fd08753e6'
AND (
token = 'S3S9HFI1tZy7yJXsWxsdJZXUchujiz149LyPwHPq9qA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)