UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFj0yCLExd9OikZWh8t/8nmzbea46RGAQfm5K6xaSmI='
WHERE
key_id = 'e9a25d7df4334b07599a0d96f2750af84a479acdc7ee6afa625b7040f51b8af1'
AND (
token = 'gFj0yCLExd9OikZWh8t/8nmzbea46RGAQfm5K6xaSmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)