UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ABc+90ZXqjSVYf6bZcOZ8YiUSK6OOx44HNeSgvZRSyY='
WHERE
key_id = 'd1832e0b7120ff411b8d1d9c1a29d4bf091f2d8249c7ab4546572950d75c2d3a'
AND (
token = 'ABc+90ZXqjSVYf6bZcOZ8YiUSK6OOx44HNeSgvZRSyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)