UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fc2Q1cYWpS+zzeWNtXJ9YTMcs6gLZtEbFdUc1Z59ctw='
WHERE
key_id = '01325d3a490daa245a07f402853d711387aea6ad1531acb8ee3e09d0986d21b0'
AND (
token = 'Fc2Q1cYWpS+zzeWNtXJ9YTMcs6gLZtEbFdUc1Z59ctw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)