UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k2yEOFDmIsz3Z+QwLUEzsj/ffGkbQ7vDXp3zcdguw9I='
WHERE
key_id = '41fdf579cff8adf490f00414bec5f5d7ae33930898d5f5544a3f73006ad66b54'
AND (
token = 'k2yEOFDmIsz3Z+QwLUEzsj/ffGkbQ7vDXp3zcdguw9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)