UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PyvQXLh+gUuAVXen5V///S09djcLV8yCbFvnRLfMoU4='
WHERE
key_id = '252e3125f64a0d3550f1b3759a0244f674c8afb38a0cb00b3ed1c8b52dddd566'
AND (
token = 'PyvQXLh+gUuAVXen5V///S09djcLV8yCbFvnRLfMoU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)