UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QqaIUPhN4VCKD10l1pXuUtF1VoxPDrh57+226IwZZ90='
WHERE
key_id = '800157cb9129539ae9fa4ff16af3bad153201c2353bfc59c4ddb75e53a178aea'
AND (
token = 'QqaIUPhN4VCKD10l1pXuUtF1VoxPDrh57+226IwZZ90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)