UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T/8uTWq40WSMYlb5DwnWjKT+4R59wMHvlfmyfJj9thw='
WHERE
key_id = 'a579d890db410630c228bdc89983a60278633a8cf01c0f823e6f4e78fa416923'
AND (
token = 'T/8uTWq40WSMYlb5DwnWjKT+4R59wMHvlfmyfJj9thw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)