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