UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Ztm8/1QPWhhnQuptPVI9ncKyATX1kWs6ZhnmcZ/h9M='
WHERE
key_id = '22dc960f2a6e67f8f47aec70b59e834e7112cdc1841c11190077e49afd676f97'
AND (
token = '0Ztm8/1QPWhhnQuptPVI9ncKyATX1kWs6ZhnmcZ/h9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)