UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kt97SFMFy+VleLV6heJroIBH0eS7mDLlaUYskU3Aso='
WHERE
key_id = 'df3a9b56ca89dfd21c0b471acf00152ea779f1ad0f64c398056498e007f945b3'
AND (
token = '1kt97SFMFy+VleLV6heJroIBH0eS7mDLlaUYskU3Aso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)