UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4tvjnSO7Eczx53L8jvpcfwW6qidQOixfNckygz/GJ4g='
WHERE
key_id = '185300d2842e5869ba87d6da0c0ee88b9b953a0b50f796c87327ee01011b3990'
AND (
token = '4tvjnSO7Eczx53L8jvpcfwW6qidQOixfNckygz/GJ4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)