UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eTnxiVoJ295rm8mVdL9yfZLe62D0/RucZJecLUAm6Ds='
WHERE
key_id = '06d9652ab761c7bef140207f5bbdf99fd22d56b0261ca957cd3c2dac598d00b0'
AND (
token = 'eTnxiVoJ295rm8mVdL9yfZLe62D0/RucZJecLUAm6Ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)