UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8m13hF69asWXl3mlWueDCV/OU/3N/TAAiSN56+lb+9w='
WHERE
key_id = 'd7c129e1623c95c6e33a2276b2454609dfb2f7c8208c234428a303b51de1daa7'
AND (
token = '8m13hF69asWXl3mlWueDCV/OU/3N/TAAiSN56+lb+9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)