UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4oPxMokme6+AKBz9mLfuXyt3R2JPAdiztTSjU4XzGTk='
WHERE
key_id = '16357f8245f3d5526ec4c216fd3944e1272a685d39f3e87de22e871643c56a77'
AND (
token = '4oPxMokme6+AKBz9mLfuXyt3R2JPAdiztTSjU4XzGTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)