UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eNZ2Sm11AX3la3LZTtuReU7hT+blbWA5GdZuuWOMdNo='
WHERE
key_id = '673bc986e31dddf9f8adb04ee1a37096a758cf5b82c2da45811dbb57907f9e15'
AND (
token = 'eNZ2Sm11AX3la3LZTtuReU7hT+blbWA5GdZuuWOMdNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)