UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CPpdDp+arrRaB3vlvvPAS+yUTOYzF4sOrHgdzQ4BAxg='
WHERE
key_id = '415bf226ede95d48149db445d398eb994039011a806ebbf2c0a69cc4e2cd67d1'
AND (
token = 'CPpdDp+arrRaB3vlvvPAS+yUTOYzF4sOrHgdzQ4BAxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)