UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pl0Ki8uHrE1cs5Bh4/ZZdlJCLefbkt6+VcZ9gq7gqhI='
WHERE
key_id = '0b90731ed5eeb759448ead869fe86144fe88bd464ece1fba4eeb5721d560ac8c'
AND (
token = 'Pl0Ki8uHrE1cs5Bh4/ZZdlJCLefbkt6+VcZ9gq7gqhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)