UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '47w7EvDJBhDSNX6HF8NX1m4iM/TbeDxm86uVvuvkN4g='
WHERE
key_id = '5914e4e5f41e0a12c4e34a5e5fc6b428ad028f6150ac01e5e4900c9c874b5b59'
AND (
token = '47w7EvDJBhDSNX6HF8NX1m4iM/TbeDxm86uVvuvkN4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)