UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fWX2yar5Xf6cbNY8aLDzuz03x8HPILex4VwBnIBy/Ec='
WHERE
key_id = '8e52da68e2c0065393c801434fdb47ce2a66766f49d84f9111263fff6f4cb00d'
AND (
token = 'fWX2yar5Xf6cbNY8aLDzuz03x8HPILex4VwBnIBy/Ec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)